/**
 * Created by Administrator on 2017/1/22.
 */

function JiCard(card, from) {
    this._card = card;
    this._from = from || 0;
    this._owner = from || 0;
    this._king = false;
    this._baseScore = 1;
    this._num = 1;
}

JiCard.prototype = {
    getCard: function() {
        return this._card;
    },

    getFrom: function() {
        return this._from;
    },

    setOwner: function(owner) {
        this._owner = owner;
    },

    getOwner: function() {
        return this._owner;
    },

    setKing: function () {
        this._king = true;
    },

    isKing: function() {
        return this._king;
    },

    isCF: function() {
        return (this._from != 0) && (this._owner == this._from);
    },

    isZR: function() {
        return (this._from != 0) && (this._owner != 0) && (this._owner != this._from);
    },

    setBaseScore: function(score) {
        this._baseScore = score || 1;
    },

    getBaseScore: function() {
        return this._baseScore * (this.isKing() ? 2 : 1);
    },

    addNum: function() {
        this._num += 1;
    },

    getNum: function() {
        return this._num;
    }
}


exports.JiCard = JiCard;